﻿using DevExpress.XtraEditors;
using QRCoder;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace MesProjectWinform.Production.Forms.ProductionReport
{
    public partial class ProductionReportForm : DevExpress.XtraEditors.XtraForm
    {
        public ProductionReportForm()
        {
            InitializeComponent();
        }

        private void simpleButton1_Click(object sender, EventArgs e)
        {
            string url = "http://120.26.25.62:8083"; // 替换为你的网址

            // 生成二维码
            QRCodeGenerator qrGenerator = new QRCodeGenerator();
            QRCodeData qrCodeData = qrGenerator.CreateQrCode(url, QRCodeGenerator.ECCLevel.Q);
            QRCode qrCode = new QRCode(qrCodeData);
            Bitmap qrCodeImage = qrCode.GetGraphic(10);

            // 弹出二维码窗体
            QRCodeForm qrForm = new QRCodeForm(qrCodeImage);
            qrForm.ShowDialog();
        }
    }
}